package com.copm.demonstrationsystem.pojo.introductionfeatures;

import com.copm.demonstrationsystem.pojo.commons.Image;
import org.hibernate.annotations.ValueGenerationType;

import javax.persistence.*;
import java.util.Date;

/**
 * @author chuyunfei
 * @date: 2018/4/8
 * @description:
 *      1、企业发展历程的实体类，发展历程的多少是不确定的，使用时间来对其进行排序
 *      2、企业发展的第几阶段将由查出来的顺序在前端进行决定
 */
@Entity
@Table(name = "company_develop_history")
public class CompanyDevelopHistory {

    @Id
    @GeneratedValue
    private Long id;

    //历程的阶段名称：初创阶段...
    private String title;

    //阶段的介绍：初创阶段什么什么的.....
    private String content;

    /**
     * 1、每一个阶段都有一张配图
     * 2、级联
     */
    @OneToOne(cascade = {CascadeType.ALL})
    private Image image;

    @OneToOne(cascade = {CascadeType.ALL})
    private Image backgroundImage;

    /**
     * 该阶段开始的时间，将使用这个开始时间来对阶段进行排序
     */
    private Long begin;

    /**
     * 该阶段结束的时间
     */
    private Long end;

    public CompanyDevelopHistory(){
    }

    public CompanyDevelopHistory(Long id){
        this.id = id;

    }
    public CompanyDevelopHistory( String title, String content, Image image,Image backgroundImage, Long begin, Long end) {

        this.title = title;
        this.content = content;
        this.image = image;
        this.backgroundImage = backgroundImage;
        this.begin = begin;
        this.end = end;
    }

    public Long getId(){
        return id;
    }

    public void setId(Long id){
        this.id = id;
    }

    public Long getBegin(){
        return begin;
    }

    public void setBegin(Long begin){
        this.begin = begin;
    }

    public Long getEnd(){
        return end;
    }

    public void setEnd(Long end){
        this.end = end;
    }

    public String getTitle(){
        return title;
    }

    public void setTitle(String title){
        this.title = title;
    }

    public String getContent(){
        return content;
    }

    public void setContent(String content){
        this.content = content;
    }

    public Image getImage(){
        return image;
    }

    public void setImage(Image image){
        this.image = image;
    }

    public Image getBackgroundImage() {
        return backgroundImage;
    }

    public void setBackgroundImage(Image backgroundImage) {
        this.backgroundImage = backgroundImage;
    }

    @Override
    public String toString() {
        return "CompanyDevelopHistory{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", image=" + image +
                ", backgroundImage=" + backgroundImage +
                ", begin=" + begin +
                ", end=" + end +
                '}';
    }
}
